﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="demoModalPopup_Calendar.aspx.cs" Inherits="AjaxControlToolKitBug_demoModalPopup_Calendar" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="demoModalPopup_Calendar.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript"> 
      // Ensure the calendar panel was shown on the top level.
      function calendarShown(sender, args) {
        sender._popupBehavior._element.style.zIndex = 1000005;
      } 
      
    </script> 
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:ScriptManager ID="ScriptManager1" runat="server">
      </asp:ScriptManager>
      
      <asp:Button 
        ID="BtnShowDialog" 
        Text="Show Dialog"
        runat="server" onclick="BtnShowDialog_Click" />
      
      <asp:Button 
        ID="BtnHidden" 
        Style="display: none" 
        runat="Server" />
      
      <cc1:ModalPopupExtender 
        ID="ModalPopupControl" 
        TargetControlID="BtnHidden" 
        PopupControlID="dialog" 
        BackgroundCssClass="popup-window-background"
        runat="server" />
      
      <asp:Panel 
        ID="dialog" 
        runat="server">
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        
        <cc1:CalendarExtender 
          ID="CalendarExtender1" 
          TargetControlID="TextBox1"
          OnClientShown="calendarShown"
          runat="server">
        </cc1:CalendarExtender>
      </asp:Panel>
    </div>
    </form>
</body>
</html>
